<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class AddMainProcessPidToIdentiyWorkExperience extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('open_shop_user_identity_card', function (Blueprint $table) {
            $table->unsignedBigInteger('mainProcessPid')->default(0)->comment('main_process表pid')->after('id');
        });

        Schema::table('open_shop_user_work_experience', function (Blueprint $table) {
            $table->unsignedBigInteger('mainProcessPid')->default(0)->comment('main_process表pid')->after('id');
        });

        // 改orderNo注释
        \Illuminate\Support\Facades\DB::statement("ALTER TABLE `kf_tiger`.`open_shop_user_identity_card`
MODIFY COLUMN `orderNo` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '主订单的orderNo,基本已废弃' AFTER `mainProcessPid`;");

        \Illuminate\Support\Facades\DB::statement("ALTER TABLE `kf_tiger`.`open_shop_user_work_experience`
MODIFY COLUMN `orderNo` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '主订单的orderNo,基本已废弃' AFTER `mainProcessPid`;");

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('open_shop_user_identity_card', function (Blueprint $table) {
            $table->dropColumn('mainProcessPid');
        });

        Schema::table('open_shop_user_work_experience', function (Blueprint $table) {
            $table->dropColumn('mainProcessPid');
        });
    }
}
